<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <title>我要请假</title>
    <header th:replace="header::html"></header>
      <link rel="stylesheet" th:href="@{/ztree/zTreeStyle/zTreeStyle.css}" />
      <link rel="stylesheet" th:href="@{/ztree/demo.css}" />
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form">
          <div class="layui-form-item">
              <label for="L_mz" class="layui-form-label">
                  <span class="x-red">*</span>姓名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_mz"  name="name" required="" lay-verify="name" autocomplete="off" class="layui-input">
              </div>
              <label for="L_sex" class="layui-form-label">
                  <span class="x-red">*</span>性别
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_sex"  name="name" required="" lay-verify="name" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
                <label for="L_bm" class="layui-form-label">
                    <span class="x-red">*</span>部门
                </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_bm"  name="name" required="" lay-verify="name" autocomplete="off" class="layui-input">
              </div>
                <label for="L_cs" class="layui-form-label">
                    <span class="x-red">*</span>出生日期
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_cs" name="name" required="" lay-verify="name" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">请假时间</label>
                    <div class="layui-inline" id="test6">
                        <div class="layui-input-inline">
                            <input type="text" autocomplete="off" id="test-startDate-1" class="layui-input" placeholder="开始日期">
                        </div>
                        <div class="layui-form-mid">到</div>
                        <div class="layui-input-inline">
                            <input type="text" autocomplete="off" id="test-endDate-1" class="layui-input" placeholder="结束日期">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">请假类别</label>
                <div class="layui-input-inline">
                    <select id="selectType" name="type" lay-filter="type" >
                        <option value="1">菜单</option>
                        <option value="2">按钮</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><span class="x-red">*</span>撤销请假理由（必填）
                </label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入理由" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
      </form>
    </div>
    <script>
      layui.use(['form','layer', 'laydate'], function() {
          $ = layui.jquery;
          var form = layui.form
              , layer = layui.layer
              , laydate = layui.laydate;
          //日期
          laydate.render({
              elem: '#test-startDate-1'
              , format: 'yyyy-MM-dd' //可任意组合
          });
          //自定义验证规则
          form.verify({
              name: function (value) {
                  if (value.length < 4) {
                      return '角色名至少4个字符';
                  }
              }
          })
      })
  </script>
  </body>
</html>